<?php


namespace App\Console\Commands;

use App\Services\Api\ChatSwooleService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

/**
 * UpdateChatRecord
 * created on 2021/2/1 16:53
 * created by chengzhigang
 */
class UpdateChatRecord extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'update:chat_record';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '定时更新聊天记录';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    /**
     * @throws \Exception
     */
    public function handle()
    {
        $topic_server = new ChatSwooleService();
        $topic_server->updateChatRecord();
        Log::info('定时更新聊天记录');
    }
}